package ex402.exercise;

public class AdditionQuestion {
    private int a;
    private int b;
    private int userAnswer;

    public AdditionQuestion(int a, int b) {
        this.a = a;
        this.b = b;
    }

    public int getAnswer() {
        return a + b;
    }

    public boolean judge() {
        return userAnswer == getAnswer();
    }

    @Override
    public String toString() {
        return String.format("%d + %d = ?", a, b);
    }

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }

    public int getUserAnswer() {
        return userAnswer;
    }

    public void setUserAnswer(int userAnswer) {
        this.userAnswer = userAnswer;
    }
}
